package com.ruoyi.storeAdd.service.impl;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.storeAdd.domain.StoreChargeOrder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.storeAdd.mapper.SysExpendDetailsMapper;
import com.ruoyi.storeAdd.domain.SysExpendDetails;
import com.ruoyi.storeAdd.service.ISysExpendDetailsService;

/**
 * 商户充值订单Service业务层处理
 *
 * @author ruoyi
 * @date 2024-06-21
 */
@Service
public class SysExpendDetailsServiceImpl implements ISysExpendDetailsService
{
    @Autowired
    private SysExpendDetailsMapper sysExpendDetailsMapper;

    /**
     * 查询商户充值订单
     *
     * @param id 商户充值订单主键
     * @return 商户充值订单
     */
    @Override
    public SysExpendDetails selectSysExpendDetailsById(Long id)
    {
        return sysExpendDetailsMapper.selectSysExpendDetailsById(id);
    }

    /**
     * 查询商户充值订单列表
     *
     * @param sysExpendDetails 商户充值订单
     * @return 商户充值订单
     */
    @Override
    public List<SysExpendDetails> selectSysExpendDetailsList(SysExpendDetails sysExpendDetails)
    {

        return sysExpendDetailsMapper.selectSysExpendDetailsList(sysExpendDetails);
    }

    /**
     * 新增商户充值订单
     *
     * @param sysExpendDetails 商户充值订单
     * @return 结果
     */
    @Override
    public int insertSysExpendDetails(SysExpendDetails sysExpendDetails)
    {
        sysExpendDetails.setCreateTime(DateUtils.getNowDate());
        return sysExpendDetailsMapper.insertSysExpendDetails(sysExpendDetails);
    }

    /**
     * 修改商户充值订单
     *
     * @param sysExpendDetails 商户充值订单
     * @return 结果
     */
    @Override
    public int updateSysExpendDetails(SysExpendDetails sysExpendDetails)
    {
        sysExpendDetails.setUpdateTime(DateUtils.getNowDate());
        return sysExpendDetailsMapper.updateSysExpendDetails(sysExpendDetails);
    }

    /**
     * 批量删除商户充值订单
     *
     * @param ids 需要删除的商户充值订单主键
     * @return 结果
     */
    @Override
    public int deleteSysExpendDetailsByIds(Long[] ids)
    {
        return sysExpendDetailsMapper.deleteSysExpendDetailsByIds(ids);
    }

    /**
     * 删除商户充值订单信息
     *
     * @param id 商户充值订单主键
     * @return 结果
     */
    @Override
    public int deleteSysExpendDetailsById(Long id)
    {
        return sysExpendDetailsMapper.deleteSysExpendDetailsById(id);
    }

    @Override
    public List<StoreChargeOrder> getStoreChargeOrder() {
        return sysExpendDetailsMapper.getStoreChargeOrder();
    }

    @Override
    public List<StoreChargeOrder> getAgentStoreChargeOrder(Date startTime, Date endTime, Long deptId) {
        return sysExpendDetailsMapper.getAgentStoreChargeOrder(startTime,endTime,deptId);
    }

    @Override
    public List<SysExpendDetails> getSysExpendDetailsList(SysExpendDetails sysExpendDetails, Date beginCreateTime, Date endCreateTime) {
        return sysExpendDetailsMapper.getSysExpendDetailsList(sysExpendDetails,beginCreateTime,endCreateTime);
    }

    @Override
    public List<StoreChargeOrder> getStoreChargeOrderOther(Long deptId) {
        return sysExpendDetailsMapper.getStoreChargeOrderOther(deptId);
    }
}
